home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / minix / up1510b.tgz / up1510b / doc / de.doc < prev    next >
Text File  |  1990-07-24  |  13KB  |  339 lines

  1. NAME
  2.     de(1)        - minix disk editor
  3.  
  4. SYNOPSIS
  5.     de [-w] /dev/device
  6.  
  7.     de -r lost_file_name
  8.  
  9. DESCRIPTION
  10.     De(1) allows a system administrator to examine and modify
  11.     a Minix file system device. Interactive observation of a
  12.     disk partition is initiated by a command line, for example:
  13.  
  14.     de /dev/hd2
  15.  
  16.     Commands are available to move to any address on the disk
  17.     and display the disk block contents. This information may
  18.     be presented in one of three visual modes: as two-byte words,
  19.     as ASCII characters or as a bit map. The disk may be searched
  20.     for a string of characters. If the "-w" option is given,
  21.     de(1) will open the device for writing and words may be
  22.     modified.
  23.  
  24.     Lost blocks and files can be recovered using a variety of
  25.     commands. The "-r" option supports automated recovery of
  26.     files removed by unlink(2).
  27.  
  28.  
  29.     POSITIONING
  30.  
  31.     Disks are divided into blocks (also called "zones") of 1024
  32.     bytes. De(1) keeps a current address on the disk as a
  33.     block number and a byte offset within the block. In some
  34.     visual modes the offset is rounded off, for example, in
  35.     "word" mode the offset must be even.
  36.  
  37.     There are different types of blocks on a file system device,
  38.     including a super block, bit maps, i-nodes and data blocks.
  39.     De(1) knows the type of the current block, but will allow
  40.     most positioning commands and visual modes to function
  41.     anywhere on the disk.
  42.  
  43.     The 'f' command (or PGDN on the keypad) moves forward to the
  44.     next block, similarly 'b' (PGUP) moves backwards one block.
  45.     'F' (END) moves to the last block and 'B' (HOME) moves to the
  46.     first block.
  47.  
  48.     The arrow keys (or 'u', 'd', 'l' and 'r') change the current
  49.     address by small increments. The size of the increment
  50.     depends on the current display mode, as shown below. The
  51.     various sizes suit each display and pointers move on the
  52.     screen to follow each press of an arrow key.
  53.  
  54.         mode     up    down    left    right
  55.  
  56.         word      -2      +2     -32      +32
  57.         block       -64     +64      -1       +1
  58.         map        -256    +256      -4       +4
  59.  
  60.  
  61.     The 'g' command allows movement to any specified block.
  62.     Like all commands that take arguments, a prompt and
  63.     subsequent input are written to the bottom line of the
  64.     screen. Numerical entry may be decimal, octal or
  65.     hexadecimal, for example 234, -1, 070, 0xf3, -X3C.
  66.  
  67.     While checking an i-node one may want to move to a block
  68.     listed as a zone of the file. The 'G' command takes the
  69.     contents at the current address in the device as a block
  70.     number and indirectly jumps to that block.
  71.  
  72.     The address may be set to the start of any i-node using
  73.     the 'i' command and supplying an i-node number. The 'I'
  74.     command maps a given file name into an i-node address.
  75.     The file must exist on the current device and this
  76.     device must be mounted so that Minix can stat(2) it.
  77.  
  78.  
  79.     THE DISPLAY
  80.  
  81.     The first line of the display contains the device name,
  82.     the name of the current output file (if one is open) and
  83.     the current search string. If de(1) is being run with
  84.     the "-w" option then the device name is flagged with "(w)".
  85.     If a string is too long to fit on the line it is marked
  86.     with "...".
  87.  
  88.     The second line contains the current block number, the
  89.     total number of blocks, and the type of the current block.
  90.     The types are: boot, super, i-node bit map, zone bit map,
  91.     i-nodes and data block. See section 5.6.2 of the text for
  92.     an explanation and a diagram. If the current address is
  93.     within a data block then the string "in use" is displayed
  94.     if the block corresponds to a set bit in the zone bit map.
  95.  
  96.     The third line shows the offset in the current block. If
  97.     the current address is within either the i-node or zone bit
  98.     maps then the i-node or block number corresponding to the
  99.     current bit is shown. If the current address is within an
  100.     i-node then the i-node number and "in use" status is displayed.
  101.     If the address is within a bit map or i-node block, but past
  102.     the last usable entry, then the string "padding" is shown.
  103.  
  104.     The rest of the screen is used to display data from the
  105.     current block. There are three visual display modes:
  106.     "word", "block" and "map". The 'v' command followed by
  107.     'w', 'b' or 'm' sets the current display mode.
  108.  
  109.     In "word" mode 16 words, of two bytes each, are shown in
  110.     either base 2, 8, 10 or 16. The current base is displayed
  111.     to the far right of the screen. It can be changed using the
  112.     'o' command followed by either an 'h' (hexadecimal), 'd'
  113.     (decimal), 'o' (octal) or 'b' (binary).
  114.  
  115.     De(1) knows where i-nodes are, and will display the
  116.     contents in a readable format, including the "rwx" bits,
  117.     the user name and the time field. If the current page
  118.     is at the beginning of the super block, or an executable
  119.     file or an ar(1) archive, then de(1) will also inform
  120.     the user. In all other cases the contents of the 16
  121.     words are shown to the right as equivalent ASCII
  122.     characters.
  123.  
  124.     In "block" mode a whole block of 1024 bytes is displayed
  125.     as ASCII characters, 64 columns by 16 lines. Control codes
  126.     are shown as highlighted characters. If the high order bit
  127.     is set in any of the 1024 bytes then an "MSB" flag is shown
  128.     on the far right of the screen, but these bytes are not
  129.     individually marked.
  130.  
  131.     In "map" mode 2048 bits (256 bytes) are displayed from the
  132.     top to the bottom (32 bits) and from the left to the right
  133.     of the screen. Bit zero of a byte is towards the top of the
  134.     screen. This visual mode is generally used to observe
  135.     the bit map blocks. The number of set bits displayed is
  136.     written on the far right of the screen.
  137.  
  138.  
  139.     SEARCHING
  140.  
  141.     A search for an ASCII string is initiated by the '/' command.
  142.     Control characters not used for other purposes may be
  143.     entered in the search string, for example ^J is an end-of-
  144.     line character. The search is from the current position to
  145.     the end of the current device.
  146.  
  147.     Once a search string has been defined by a use of '/', the
  148.     next search may be initiated with the 'n' command, (a '/'
  149.     followed immediately by an ENTER is equivalent to an 'n').
  150.  
  151.     Whenever a search is in progress de(1) will append one
  152.     '.' to the prompt line for every 500 blocks searched. If the
  153.     string is found between the end of the file system and the
  154.     actual end of the device, then the current address is set to
  155.     the end of the file system.
  156.  
  157.     Some of the positioning commands push the current address
  158.     and visual mode in a stack before going to a new address.
  159.     These commands are B, F, g, G, i, I, n, x and /. The 'p'
  160.     (previous) command pops the last address and visual mode
  161.     from the stack. This stack is eight entries deep.
  162.  
  163.  
  164.     MODIFYING THE FILE SYSTEM
  165.  
  166.     The 's' command will prompt for a data word and store it at
  167.     the current address on the disk. This is used to change
  168.     information that can not be easily changed by any other
  169.     means.
  170.  
  171.     The data word is 16 bits wide, it may be entered in decimal,
  172.     octal or hexadecimal. Remember that the "-w" option must
  173.     be specified for the 's' command to operate. Be careful
  174.     when modifying a mounted file system.
  175.  
  176.  
  177.     RECOVERING FILES
  178.  
  179.     Any block on the disk may be written to an output file.
  180.     This is used to recover blocks marked as free on the
  181.     disk. A write command will request a file name the first
  182.     time it is used, on subsequent writes the data is appended
  183.     to the current output file.
  184.  
  185.     The name of the current output file is changed using the
  186.     'c' command. This file should be on a different file system,
  187.     to avoid overwriting an i-node or block before it is
  188.     recovered.
  189.  
  190.     An ASCII block is usually recovered using the 'w' command.
  191.     All bytes will have their most significant bit cleared before
  192.     being written to the output file. Bytes containing '\0' or
  193.     '\177' are not copied. The 'W' command writes the current
  194.     block (1024 bytes) exactly to the output file.
  195.  
  196.     When a file is deleted using unlink(2) the i-node number
  197.     in the directory is zeroed, but before its removal,